package com.example.jimanguang.Entity;

import com.fasterxml.jackson.annotation.JsonBackReference;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Entity
@Table(name = "collect")
@Getter
@Setter
public class Collect extends BaseEntity {
    @Temporal(TemporalType.TIMESTAMP)//确保实体类中的属性类型与数据库中的时间属性类型相匹配
    private Date CollectTime;//用户收藏的时间

    @ManyToOne
    private User user;
    @OneToOne
    private Comics comics;

    public Collect() {
        CollectTime = new Date();
    }

    @JsonBackReference
    public User getUser(){return user;}


}
